class PlanTable {
    constructor() {
        this.data = undefined;
        this.table = undefined;
        this.head = undefined
        layui.use('table', () => {
            this.table = layui.table;
        });
    }
    setData(head, data) {
        let utilsBtn = { title: '操作', fixed: 'right', width: 200, align: 'center', toolbar: '#bar_plan_table' };
        //    head.push(utilsBtn);
        head.unshift({ checkbox: true, LAY_CHECKED: true });
        this.head = head;
        this.data = data;


        this.table.render({
            id: 'plan_table',
            height: 'full-250',
            skin: 'row',
            page: true,
            elem: '#plan_table',
            cols: [head],
            data: data,
            size: 'sm',
            even: true


        });
        this.table.on('tool(plan_table)', (obj) => {
            console.log(obj);
        });
    }
    getData() {
        let checkStatus = this.table.checkStatus('plan_table');
        let data = checkStatus.data;
        return data;

    }
}
export default PlanTable;